<%--
  Created by IntelliJ IDEA.
  User: q
  Date: 2022/6/8
  Time: 上午 9:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<body>
<%! int count=0;
// 使用synchronized关键字来标记一个【同步方法】,对临界资源加上互斥锁
synchronized void setCount() {
    count++;
}
%>
<%
    setCount();
    out.println("您是第"+count+"个访问本站的用户");
    %>
</body>
</html>
